package com.ease.framework.gef4g.actions
{
	import com.ease.framework.gef4g.GraphicalViewport;
	import com.ease.framework.gef4g.IGraphicalEditor;
	import com.ease.framework.gef4g.IGraphicalViewer;
	import com.ease.framework.layers.Layer;
	import com.ease.framework.workbench.Workbench;
	
	import flash.events.MouseEvent;
	
	import mx.controls.CheckBox;

	public class LaneLayerCheckBox extends CheckBox
	{
		public function LaneLayerCheckBox()
		{
			super();
			this.addEventListener(MouseEvent.CLICK, onMouseClick);
		}
		
		protected function onMouseClick(event:MouseEvent):void{
			var layer:Layer = IGraphicalViewer(IGraphicalEditor(Workbench.instance.currentEditor).getViewer()).getViewport().getLayer(GraphicalViewport.LAYER_LANE);
			if(this.selected){
				layer.visible = true;
			}else{
				layer.visible = false;
			}
		}
		
	}
}